//
//  UIColor+Extension.m
//  DGGUIKit
//
//  Created by 周家民 on 2020/6/11.
//

#import "UIColor+DGGUIKit.h"

@implementation UIColor (DGGUIKit)

- (UIColor *)setDrakModeColor:(UIColor *)darkModeColor {
    if (@available(iOS 13.0, *)) {
        return [UIColor colorWithDynamicProvider:^UIColor * _Nonnull(UITraitCollection * _Nonnull traitCollection) {
            if (traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark) {
                return darkModeColor;
            } else {
                return self;
            }
        }];
    } else {
        return self;
    }
}

@end
